<%@ WebHandler Language="C#" Class="HttpHandlerInside" %>

using System;
using System.Web;

using MetaSapiens.PageMethods;

public class HttpHandlerInside : IHttpHandler
{
	HttpContext _context;

	public void ProcessRequest(HttpContext context)
	{
		_context = context;
		PageMethodsEngine.InvokeMethod(this, true);
	}

	public bool IsReusable
	{
		get { return false; }
	}

	[PageMethod(true)]
	public void SampleMethod(int i)
	{
		_context.Response.ContentType = "text/plain";
		_context.Response.Write("Hello from HTTP handler (code inside). i == " + i);
	}
}